
# ABCCBA = A * 100001 + B * 10010 + C * 1100
#        = (A * 9091 + B * 7 * 13 * 10 + C * 100) * 11


def main():
    for a in range(1, 10):
        for b in range(10):
            for c in range(10):
                A = 10 - a
                B = 9 - b
                C = 9 -c
                b_num = A*9091 + B*910 + C*100
                num = b_num * 11

                for g in range(999, 100, -1):
                    if num % g == 0:
                        h = num // g
                        if 0 < h // 100 < 10:
                            return num, g, h

print(main())
# result: 906609, 993, 913
